ci: install winget via Repair-WinGetPackageManager#597
ci: install winget via Repair-WinGetPackageManager#597wmmc88 merged 2 commits intomicrosoft:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request simplifies Winget installation on Windows ARM64 runners by replacing a custom composite GitHub Action with a direct PowerShell command (Repair-WinGetPackageManager -Latest -Force). The change reduces complexity by leveraging the built-in capabilities of the Microsoft.WinGet.Client PowerShell module, which is now installed on all Windows runners before the Winget installation step.
Key changes:
- Removed the custom
.github/actions/install-wingetcomposite action that handled manual download and installation of Winget v1.11.400 with dependencies - Updated all workflow files to use
Repair-WinGetPackageManager -Latest -Forcefor ARM64 runners - The PowerShell module installation step is now unconditionally executed on all runners (needed by downstream actions), while Winget repair/installation remains conditional on ARM64
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.github/actions/install-winget/action.yaml |
Removed the entire custom composite action that manually downloaded and installed Winget with architecture-specific dependencies |
.github/workflows/test.yaml |
Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.arch == 'arm64' conditional |
.github/workflows/local-development-makefile.yaml |
Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional |
.github/workflows/lint.yaml |
Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional |
.github/workflows/docs.yaml |
Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional |
.github/workflows/build.yaml |
Replaced custom action usage with direct Repair-WinGetPackageManager command; uses matrix.runner.name == 'windows-11-arm' conditional |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #597 +/- ##
=======================================
Coverage 82.67% 82.67%
=======================================
Files 25 25
Lines 7135 7135
Branches 7135 7135
=======================================
Hits 5899 5899
Misses 1107 1107
Partials 129 129 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@wmmc88 You might want to update this statement in the PR description: "The custom .github/actions/install-winget composite action and its usage have been removed from all workflow files." |
This pull request refactors the GitHub Action for installing Winget on Windows runners, simplifying the installation process and improving support for images that may not include
winget-cli(notably Windows ARM64 partner images). The changes remove the need for a GitHub token, streamline the workflow YAML files, and introduce a newforce-cli-installinput to control Winget installation behavior.Action and Workflow Refactoring:
Refactored
.github/actions/install-winget/action.yamlto:GITHUB_TOKENinput and all related authenticated API requests.force-cli-installinput to optionally force installation of the latest Winget CLI for images missingwinget-cli.Microsoft.WinGet.ClientPowerShell module and theRepair-WinGetPackageManagercommand when forced installation is needed.Updated all workflow files (
build.yaml,test.yaml,lint.yaml,docs.yaml,local-development-makefile.yaml) to:GITHUB_TOKENinput.force-cli-installinput to control when Winget should be forcibly installed, specifically for thewindows-11-armrunner image. [1] [2] [3] [4] [5]Improved Support for Windows ARM64:
windows-11-armrunner image, which does not includewinget-cliby default, will have Winget installed reliably by settingforce-cli-install: truefor this runner. [1] [2] [3] [4] [5]General Simplification and Reliability:
These changes make Winget installation more robust and easier to maintain across different Windows runner environments.
Related to microsoft/Windows-rust-driver-samples#48